home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / file-tra / rdist-6.1 / rdist-6 / rdist-6.1.0-linuxpl2 / src / strdup.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-11  |  622 b   |  35 lines

  1. #ifndef lint
  2. static char *RCSid = "$Header: /src/common/usc/lib/libgen/RCS/strdup.c,v 1.2 1992/04/16 01:28:02 mcooper Exp mcooper $";
  3. #endif
  4.  
  5. /*
  6.  * $Log: strdup.c,v $
  7.  * Revision 1.2  1992/04/16  01:28:02  mcooper
  8.  * Some de-linting.
  9.  *
  10.  * Revision 1.1  1992/03/21  02:48:11  mcooper
  11.  * Initial revision
  12.  *
  13.  */
  14.  
  15.  
  16. #include <stdio.h>
  17.  
  18. /*
  19.  * Most systems don't have this (yet)
  20.  */
  21. char *strdup(str)
  22.      char *str;
  23. {
  24.     char                *p;
  25.     extern char               *malloc();
  26.     extern char               *strcpy();
  27.  
  28.     if ((p = malloc(strlen(str)+1)) == NULL)
  29.     return((char *) NULL);
  30.  
  31.     (void) strcpy(p, str);
  32.  
  33.     return(p);
  34. }
  35.